<template>
  <div class="demo-title">sticky/demo1</div>
  <Sticky @change="onChange">
    <div class="sticky-row">我要吸顶</div>
  </Sticky>
  <div style="min-height: 100vh">
    <p v-for="(item) in 10">填充内容{{item}}</p>
  </div>
</template>

<script lang="ts" setup>
  import Sticky from '@sscd-mobile/sticky'
  const onChange = (isSticky: boolean) => console.log(isSticky ? '我吸顶了' : '我又不吸了')
</script>

<style lang="less" scoped>
  .sticky-row {
    height: 40px;
    background: #3268ff;
    color: #fff;
    text-align: center;
    line-height: 40px;
  }
  p {
    padding-left: 12px;
    line-height: 150px;
  }
</style>
